#ifndef USER_H
#define USER_H

#include "log.h"

enum SocketState{
    Undefined,
    WaitForQueryTransmission,
    WaitForDataTransmission
};

class User : public QObject
{
    Q_OBJECT
public:
    User(QTcpSocket* socket, QObject *parent = 0);
    ~User();

    quint16 getUserID(){ return _userID; }
    quint16 getConnectionID(){ return _connectionID; }
    QTcpSocket* getDataSocket(){ return _dataSocket; }
    QTcpSocket* getTickSocket(){ return _tickSocket; }

    int authorize(QString login, QString password);

    QString curentNick;
    QString status;

    int level;

    SocketState dataSocketState;
    SocketState tickSocketState;
private:
    QTcpSocket *_dataSocket;
    QTcpSocket *_tickSocket;

    quint16 _userID;
    quint16 _connectionID;

    bool _isAuthorize;


};

#endif // USER_H
